package com.tcm.controller.backend;

import com.tcm.entity.resp.R;
import com.tcm.service.HomeService;
import com.tcm.utils.AccessTokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 首页控制器
 * @author Guqier
 * @version 1.0
 * @date 2023/8/2 14:54
 */
@RestController
@RequestMapping("/pc/home")
public class HomeController {

    @Autowired
    private HomeService homeService;

    /**
     * 获取首页教师教学计划
     * @param request http请求对象
     * @return 教师教学计划
     */
    @RequestMapping(value = "/teaching", method = RequestMethod.GET)
    public R getTeacherTeachingList(HttpServletRequest request){
        return R.success(homeService.getTeacherTeachingList(AccessTokenUtil.getUserId(request)));
    }

}
